/**
* EaselJS
* Visit http://easeljs.com/ for documentation, updates and examples.
*
* Copyright (c) 2011 Grant Skinner
* 
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
* 
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
**/
(function(k){var c=function(){throw"UID cannot be instantiated";};c._nextID=0;c.get=function(){return c._nextID++};k.UID=c})(window);(function(k){var c=function(){throw"Ticker cannot be instantiated.";};c.useRAF=null;c._listeners=null;c._pauseable=null;c._paused=false;c._inited=false;c._startTime=0;c._pausedTime=0;c._ticks=0;c._pausedTickers=0;c._interval=50;c._lastTime=0;c._times=null;c._tickTimes=null;c._rafActive=false;c._timeoutID=null;c.addListener=function(a,b){c._inited||c.init();c.removeListener(a);c._pauseable[c._listeners.length]=b==null?true:b;c._listeners.push(a)};c.init=function(){c._inited=true;c._times=[];c._tickTimes=
[];c._pauseable=[];c._listeners=[];c._times.push(c._startTime=c._getTime());c.setInterval(c._interval)};c.removeListener=function(a){c._listeners!=null&&(a=c._listeners.indexOf(a),a!=-1&&(c._listeners.splice(a,1),c._pauseable.splice(a,1)))};c.removeAllListeners=function(){c._listeners=[];c._pauseable=[]};c.setInterval=function(a){c._lastTime=c._getTime();c._interval=a;c.timeoutID!=null&&clearTimeout(c.timeoutID);if(c.useRAF){if(c._rafActive)return;c._rafActive=true;var b=k.requestAnimationFrame||
k.webkitRequestAnimationFrame||k.mozRequestAnimationFrame||k.oRequestAnimationFrame||k.msRequestAnimationFrame;if(b){b(c._handleAF);return}}if(c._inited)c.timeoutID=setTimeout(c._handleTimeout,a)};c.getInterval=function(){return c._interval};c.setFPS=function(a){c.setInterval(1E3/a)};c.getFPS=function(){return 1E3/c._interval};c.getMeasuredFPS=function(a){if(c._times.length<2)return-1;a==null&&(a=c.getFPS()>>1);a=Math.min(c._times.length-1,a);return 1E3/((c._times[0]-c._times[a])/a)};c.setPaused=
function(a){c._paused=a};c.getPaused=function(){return c._paused};c.getTime=function(a){return c._getTime()-c._startTime-(a?c._pausedTime:0)};c.getTicks=function(a){return c._ticks-(a?c._pausedTickers:0)};c._handleAF=function(a){a-c._lastTime>=c._interval-1&&c._tick();c.useRAF?(k.requestAnimationFrame||k.webkitRequestAnimationFrame||k.mozRequestAnimationFrame||k.oRequestAnimationFrame||k.msRequestAnimationFrame)(c._handleAF,c.animationTarget):c._rafActive=false};c._handleTimeout=function(){c._tick();
if(!c.useRAF)c.timeoutID=setTimeout(c._handleTimeout,c._interval)};c._tick=function(){c._ticks++;var a=c._getTime(),b=a-c._lastTime,o=c._paused;o&&(c._pausedTickers++,c._pausedTime+=b);c._lastTime=a;for(var f=c._pauseable,e=c._listeners.slice(),d=e?e.length:0,g=0;g<d;g++){var h=f[g],j=e[g];j==null||o&&h||j.tick==null||j.tick(b,o)}for(c._tickTimes.unshift(c._getTime()-a);c._tickTimes.length>100;)c._tickTimes.pop();for(c._times.unshift(a);c._times.length>100;)c._times.pop()};c._getTime=function(){return(new Date).getTime()};
k.Ticker=c})(window);(function(k){var c=function(b,a,f,c,d){this.initialize(b,a,f,c,d)},a=c.prototype;a.stageX=0;a.stageY=0;a.type=null;a.nativeEvent=null;a.onMouseMove=null;a.onMouseUp=null;a.target=null;a.initialize=function(b,a,f,c,d){this.type=b;this.stageX=a;this.stageY=f;this.target=c;this.nativeEvent=d};a.clone=function(){return new c(this.type,this.stageX,this.stageY,this.target,this.nativeEvent)};a.toString=function(){return"[MouseEvent (type="+this.type+" stageX="+this.stageX+" stageY="+this.stageY+")]"};k.MouseEvent=
c})(window);(function(k){var c=function(b,a,f,c,d,g){this.initialize(b,a,f,c,d,g)},a=c.prototype;c.identity=null;c.DEG_TO_RAD=Math.PI/180;a.a=1;a.b=0;a.c=0;a.d=1;a.tx=0;a.ty=0;a.alpha=1;a.shadow=null;a.compositeOperation=null;a.initialize=function(b,a,f,c,d,g){if(b!=null)this.a=b;this.b=a||0;this.c=f||0;if(c!=null)this.d=c;this.tx=d||0;this.ty=g||0};a.prepend=function(b,a,f,c,d,g){var h=this.tx;if(b!=1||a!=0||f!=0||c!=1){var j=this.a,i=this.c;this.a=j*b+this.b*f;this.b=j*a+this.b*c;this.c=i*b+this.d*f;this.d=
i*a+this.d*c}this.tx=h*b+this.ty*f+d;this.ty=h*a+this.ty*c+g};a.append=function(b,a,f,c,d,g){var h=this.a,j=this.b,i=this.c,l=this.d;this.a=b*h+a*i;this.b=b*j+a*l;this.c=f*h+c*i;this.d=f*j+c*l;this.tx=d*h+g*i+this.tx;this.ty=d*j+g*l+this.ty};a.prependMatrix=function(b){this.prepend(b.a,b.b,b.c,b.d,b.tx,b.ty);this.prependProperties(b.alpha,b.shadow,b.compositeOperation)};a.appendMatrix=function(b){this.append(b.a,b.b,b.c,b.d,b.tx,b.ty);this.appendProperties(b.alpha,b.shadow,b.compositeOperation)};
a.prependTransform=function(b,a,f,e,d,g,h,j,i){if(d%360)var l=d*c.DEG_TO_RAD,d=Math.cos(l),l=Math.sin(l);else d=1,l=0;if(j||i)this.tx-=j,this.ty-=i;g||h?(g*=c.DEG_TO_RAD,h*=c.DEG_TO_RAD,this.prepend(d*f,l*f,-l*e,d*e,0,0),this.prepend(Math.cos(h),Math.sin(h),-Math.sin(g),Math.cos(g),b,a)):this.prepend(d*f,l*f,-l*e,d*e,b,a)};a.appendTransform=function(b,a,f,e,d,g,h,j,i){if(d%360)var l=d*c.DEG_TO_RAD,d=Math.cos(l),l=Math.sin(l);else d=1,l=0;g||h?(g*=c.DEG_TO_RAD,h*=c.DEG_TO_RAD,this.append(Math.cos(h),
Math.sin(h),-Math.sin(g),Math.cos(g),b,a),this.append(d*f,l*f,-l*e,d*e,0,0)):this.append(d*f,l*f,-l*e,d*e,b,a);if(j||i)this.tx-=j*this.a+i*this.c,this.ty-=j*this.b+i*this.d};a.rotate=function(b){var a=Math.cos(b),b=Math.sin(b),f=this.a,c=this.c,d=this.tx;this.a=f*a-this.b*b;this.b=f*b+this.b*a;this.c=c*a-this.d*b;this.d=c*b+this.d*a;this.tx=d*a-this.ty*b;this.ty=d*b+this.ty*a};a.skew=function(b,a){b*=c.DEG_TO_RAD;a*=c.DEG_TO_RAD;this.append(Math.cos(a),Math.sin(a),-Math.sin(b),Math.cos(b),0,0)};a.scale=
function(b,a){this.a*=b;this.d*=a;this.tx*=b;this.ty*=a};a.translate=function(b,a){this.tx+=b;this.ty+=a};a.identity=function(){this.alpha=this.a=this.d=1;this.b=this.c=this.tx=this.ty=0;this.shadow=this.compositeOperation=null};a.invert=function(){var b=this.a,a=this.b,f=this.c,c=this.d,d=this.tx,g=b*c-a*f;this.a=c/g;this.b=-a/g;this.c=-f/g;this.d=b/g;this.tx=(f*this.ty-c*d)/g;this.ty=-(b*this.ty-a*d)/g};a.isIdentity=function(){return this.tx==0&&this.ty==0&&this.a==1&&this.b==0&&this.c==0&&this.d==
1};a.decompose=function(b){b==null&&(b={});b.x=this.tx;b.y=this.ty;b.scaleX=Math.sqrt(this.a*this.a+this.b*this.b);b.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var a=Math.atan2(-this.c,this.d),f=Math.atan2(this.b,this.a);a==f?(b.rotation=f/c.DEG_TO_RAD,this.a<0&&this.d>=0&&(b.rotation+=b.rotation<=0?180:-180),b.skewX=b.skewY=0):(b.skewX=a/c.DEG_TO_RAD,b.skewY=f/c.DEG_TO_RAD);return b};a.reinitialize=function(b,a,f,c,d,g,h,j,i){this.initialize(b,a,f,c,d,g);this.alpha=h||1;this.shadow=j;this.compositeOperation=
i;return this};a.appendProperties=function(b,a,f){this.alpha*=b;this.shadow=a||this.shadow;this.compositeOperation=f||this.compositeOperation};a.prependProperties=function(b,a,f){this.alpha*=b;this.shadow=this.shadow||a;this.compositeOperation=this.compositeOperation||f};a.clone=function(){var b=new c(this.a,this.b,this.c,this.d,this.tx,this.ty);b.shadow=this.shadow;b.alpha=this.alpha;b.compositeOperation=this.compositeOperation;return b};a.toString=function(){return"[Matrix2D (a="+this.a+" b="+this.b+
" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+")]"};c.identity=new c(1,0,0,1,0,0);k.Matrix2D=c})(window);(function(k){var c=function(b,a){this.initialize(b,a)},a=c.prototype;a.x=0;a.y=0;a.initialize=function(b,a){this.x=b==null?0:b;this.y=a==null?0:a};a.clone=function(){return new c(this.x,this.y)};a.toString=function(){return"[Point (x="+this.x+" y="+this.y+")]"};k.Point=c})(window);(function(k){var c=function(b,a,f,c){this.initialize(b,a,f,c)},a=c.prototype;a.x=0;a.y=0;a.width=0;a.height=0;a.initialize=function(b,a,f,c){this.x=b==null?0:b;this.y=a==null?0:a;this.width=f==null?0:f;this.height=c==null?0:c};a.clone=function(){return new c(this.x,this.y,this.width,this.height)};a.toString=function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")]"};k.Rectangle=c})(window);(function(k){var c=function(b,a,f,c){this.initialize(b,a,f,c)},a=c.prototype;c.identity=null;a.color=null;a.offsetX=0;a.offsetY=0;a.blur=0;a.initialize=function(b,a,f,c){this.color=b;this.offsetX=a;this.offsetY=f;this.blur=c};a.toString=function(){return"[Shadow]"};a.clone=function(){return new c(this.color,this.offsetX,this.offsetY,this.blur)};c.identity=new c("transparent",0,0,0);k.Shadow=c})(window);(function(k){var c=function(b){this.initialize(b)},a=c.prototype;a.complete=true;a._animations=null;a._frames=null;a._images=null;a._data=null;a._loadCount=0;a._frameHeight=0;a._frameWidth=0;a._numFrames=0;a._regX=0;a._regY=0;a.initialize=function(b){var a,f,c;if(b!=null){if(b.images&&(f=b.images.length)>0){c=this._images=[];for(a=0;a<f;a++){var d=b.images[a];if(!(d instanceof Image)){var g=d,d=new Image;d.src=g}c.push(d);if(!d.getContext&&!d.complete)this._loadCount++,this.complete=false,d.onload=
this._handleImageLoad()}}if(b.frames!=null)if(b.frames instanceof Array){this._frames=[];c=b.frames;for(a=0,f=c.length;a<f;a++)d=c[a],this._frames.push({image:this._images[d[4]?d[4]:0],rect:new Rectangle(d[0],d[1],d[2],d[3]),regX:d[5]||0,regY:d[6]||0})}else f=b.frames,this._frameWidth=f.width,this._frameHeight=f.height,this._regX=f.regX||0,this._regY=f.regY||0,this._numFrames=f.count,this._loadCount==0&&this._calculateFrames();if((f=b.animations)!=null){this._animations=[];this._data={};for(var h in f){b=
{name:h};d=f[h];if(isNaN(d))if(d instanceof Array){b.frequency=d[3];b.next=d[2];c=b.frames=[];for(a=d[0];a<=d[1];a++)c.push(a)}else b.frequency=d.frequency,b.next=d.next,c=b.frames=d.frames.slice(0);else c=b.frames=[d];b.next=c.length<2||b.next==false?null:b.next==true?h:b.next;if(!b.frequency)b.frequency=1;this._animations.push(h);this._data[h]=b}}}};a.getNumFrames=function(b){return b==null?this._frames?this._frames.length:this._numFrames:(b=this._data[b],b==null?0:b.frames.length)};a.getAnimations=
function(){return this._animations.slice(0)};a.getAnimation=function(b){return this._data[b]};a.getFrame=function(b){return this.complete&&this._frames&&(frame=this._frames[b])?frame:null};a.toString=function(){return"[SpriteSheet]"};a.clone=function(){var b=new c;b.complete=this.complete;b._animations=this._animations;b._frames=this._frames;b._images=this._images;b._data=this._data;b._frameHeight=this._frameHeight;b._frameWidth=this._frameWidth;b._numFrames=this._numFrames;b._loadCount=this._loadCount;
return b};a._handleImageLoad=function(){if(--this._loadCount==0)this._calculateFrames(),this.complete=true};a._calculateFrames=function(){if(!(this._frames||this._frameWidth==0)){this._frames=[];for(var b=0,a=this._frameWidth,c=this._frameHeight,e=0,d=this._images;e<d.length;e++){for(var g=d[e],h=(g.width+1)/a|0,j=(g.height+1)/c|0,j=this._numFrames>0?Math.min(this._numFrames-b,h*j):h*j,i=0;i<j;i++)this._frames.push({image:g,rect:new Rectangle(i%h*a,(i/h|0)*c,a,c),regX:this._regX,regY:this._regY});
b+=j}this._numFrames=b}};k.SpriteSheet=c})(window);(function(k){function c(b,a){this.f=b;this.params=a}c.prototype.exec=function(b){this.f.apply(b,this.params)};var a=function(){this.initialize()},b=a.prototype;a.getRGB=function(b,a,c,d){b!=null&&c==null&&(d=a,c=b&255,a=b>>8&255,b=b>>16&255);return d==null?"rgb("+b+","+a+","+c+")":"rgba("+b+","+a+","+c+","+d+")"};a.getHSL=function(b,a,c,d){return d==null?"hsl("+b%360+","+a+"%,"+c+"%)":"hsla("+b%360+","+a+"%,"+c+"%,"+d+")"};a.STROKE_CAPS_MAP=["butt","round","square"];a.STROKE_JOINTS_MAP=["miter","round",
"bevel"];a._ctx=document.createElement("canvas").getContext("2d");a.beginCmd=new c(a._ctx.beginPath,[]);a.fillCmd=new c(a._ctx.fill,[]);a.strokeCmd=new c(a._ctx.stroke,[]);b._strokeInstructions=null;b._strokeStyleInstructions=null;b._fillInstructions=null;b._instructions=null;b._oldInstructions=null;b._activeInstructions=null;b._active=false;b._dirty=false;b.initialize=function(){this.clear();this._ctx=a._ctx};b.draw=function(b){this._dirty&&this._updateInstructions();for(var a=this._instructions,
c=0,d=a.length;c<d;c++)a[c].exec(b)};b.moveTo=function(b,a){this._activeInstructions.push(new c(this._ctx.moveTo,[b,a]));return this};b.lineTo=function(b,a){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.lineTo,[b,a]));return this};b.arcTo=function(b,a,e,d,g){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.arcTo,[b,a,e,d,g]));return this};b.arc=function(b,a,e,d,g,h){this._dirty=this._active=true;h==null&&(h=false);this._activeInstructions.push(new c(this._ctx.arc,
[b,a,e,d,g,h]));return this};b.quadraticCurveTo=function(b,a,e,d){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.quadraticCurveTo,[b,a,e,d]));return this};b.bezierCurveTo=function(b,a,e,d,g,h){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.bezierCurveTo,[b,a,e,d,g,h]));return this};b.rect=function(b,a,e,d){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.rect,[b,a,e,d]));return this};b.closePath=function(){if(this._active)this._dirty=
true,this._activeInstructions.push(new c(this._ctx.closePath,[]));return this};b.clear=function(){this._instructions=[];this._oldInstructions=[];this._activeInstructions=[];this._strokeStyleInstructions=this._strokeInstructions=this._fillInstructions=null;this._active=this._dirty=false;return this};b.beginFill=function(b){this._active&&this._newPath();this._fillInstructions=b?[new c(this._setProp,["fillStyle",b])]:null;return this};b.beginLinearGradientFill=function(b,a,e,d,g,h){this._active&&this._newPath();
e=this._ctx.createLinearGradient(e,d,g,h);d=0;for(g=b.length;d<g;d++)e.addColorStop(a[d],b[d]);this._fillInstructions=[new c(this._setProp,["fillStyle",e])];return this};b.beginRadialGradientFill=function(b,a,e,d,g,h,j,i){this._active&&this._newPath();e=this._ctx.createRadialGradient(e,d,g,h,j,i);d=0;for(g=b.length;d<g;d++)e.addColorStop(a[d],b[d]);this._fillInstructions=[new c(this._setProp,["fillStyle",e])];return this};b.beginBitmapFill=function(b,a){this._active&&this._newPath();var e=this._ctx.createPattern(b,
a||"");this._fillInstructions=[new c(this._setProp,["fillStyle",e])];return this};b.endFill=function(){this.beginFill(null);return this};b.setStrokeStyle=function(b,f,e,d){this._active&&this._newPath();this._strokeStyleInstructions=[new c(this._setProp,["lineWidth",b==null?"1":b]),new c(this._setProp,["lineCap",f==null?"butt":isNaN(f)?f:a.STROKE_CAPS_MAP[f]]),new c(this._setProp,["lineJoin",e==null?"miter":isNaN(e)?e:a.STROKE_JOINTS_MAP[e]]),new c(this._setProp,["miterLimit",d==null?"10":d])];return this};
b.beginStroke=function(b){this._active&&this._newPath();this._strokeInstructions=b?[new c(this._setProp,["strokeStyle",b])]:null;return this};b.beginLinearGradientStroke=function(b,a,e,d,g,h){this._active&&this._newPath();e=this._ctx.createLinearGradient(e,d,g,h);d=0;for(g=b.length;d<g;d++)e.addColorStop(a[d],b[d]);this._strokeInstructions=[new c(this._setProp,["strokeStyle",e])];return this};b.beginRadialGradientStroke=function(b,a,e,d,g,h,j,i){this._active&&this._newPath();e=this._ctx.createRadialGradient(e,
d,g,h,j,i);d=0;for(g=b.length;d<g;d++)e.addColorStop(a[d],b[d]);this._strokeInstructions=[new c(this._setProp,["strokeStyle",e])];return this};b.beginBitmapStroke=function(b,a){this._active&&this._newPath();var e=this._ctx.createPattern(b,a||"");this._strokeInstructions=[new c(this._setProp,["strokeStyle",e])];return this};b.endStroke=function(){this.beginStroke(null);return this};b.curveTo=b.quadraticCurveTo;b.drawRect=b.rect;b.drawRoundRect=function(b,a,c,d,g){this.drawRoundRectComplex(b,a,c,d,
g,g,g,g);return this};b.drawRoundRectComplex=function(b,a,e,d,g,h,j,i){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.moveTo,[b+g,a]),new c(this._ctx.lineTo,[b+e-h,a]),new c(this._ctx.arc,[b+e-h,a+h,h,-Math.PI/2,0,false]),new c(this._ctx.lineTo,[b+e,a+d-j]),new c(this._ctx.arc,[b+e-j,a+d-j,j,0,Math.PI/2,false]),new c(this._ctx.lineTo,[b+i,a+d]),new c(this._ctx.arc,[b+i,a+d-i,i,Math.PI/2,Math.PI,false]),new c(this._ctx.lineTo,[b,a+g]),new c(this._ctx.arc,[b+g,a+g,g,Math.PI,
Math.PI*3/2,false]));return this};b.drawCircle=function(b,a,c){this.arc(b,a,c,0,Math.PI*2);return this};b.drawEllipse=function(b,a,e,d){this._dirty=this._active=true;var g=e/2*0.5522848,h=d/2*0.5522848,j=b+e,i=a+d,e=b+e/2,d=a+d/2;this._activeInstructions.push(new c(this._ctx.moveTo,[b,d]),new c(this._ctx.bezierCurveTo,[b,d-h,e-g,a,e,a]),new c(this._ctx.bezierCurveTo,[e+g,a,j,d-h,j,d]),new c(this._ctx.bezierCurveTo,[j,d+h,e+g,i,e,i]),new c(this._ctx.bezierCurveTo,[e-g,i,b,d+h,b,d]));return this};b.drawPolyStar=
function(b,a,e,d,g,h){this._dirty=this._active=true;g==null&&(g=0);g=1-g;h==null?h=0:h/=180/Math.PI;var j=Math.PI/d;this._activeInstructions.push(new c(this._ctx.moveTo,[b+Math.cos(h)*e,a+Math.sin(h)*e]));for(var i=0;i<d;i++)h+=j,g!=1&&this._activeInstructions.push(new c(this._ctx.lineTo,[b+Math.cos(h)*e*g,a+Math.sin(h)*e*g])),h+=j,this._activeInstructions.push(new c(this._ctx.lineTo,[b+Math.cos(h)*e,a+Math.sin(h)*e]));return this};b.clone=function(){var b=new a;b._instructions=this._instructions.slice();
b._activeInstructions=this._activeInstructions.slice();b._oldInstructions=this._oldInstructions.slice();if(this._fillInstructions)b._fillInstructions=this._fillInstructions.slice();if(this._strokeInstructions)b._strokeInstructions=this._strokeInstructions.slice();if(this._strokeStyleInstructions)b._strokeStyleInstructions=this._strokeStyleInstructions.slice();b._active=this._active;b._dirty=this._dirty;return b};b.toString=function(){return"[Graphics]"};b.mt=b.moveTo;b.lt=b.lineTo;b.at=b.arcTo;b.bt=
b.bezierCurveTo;b.qt=b.quadraticCurveTo;b.a=b.arc;b.r=b.rect;b.cp=b.closePath;b.c=b.clear;b.f=b.beginFill;b.lf=b.beginLinearGradientFill;b.rf=b.beginRadialGradientFill;b.bf=b.beginBitmapFill;b.ef=b.endFill;b.ss=b.setStrokeStyle;b.s=b.beginStroke;b.ls=b.beginLinearGradientStroke;b.rs=b.beginRadialGradientStroke;b.bs=b.beginBitmapStroke;b.es=b.endStroke;b.dr=b.drawRect;b.rr=b.drawRoundRect;b.rc=b.drawRoundRectComplex;b.dc=b.drawCircle;b.de=b.drawEllipse;b.dp=b.drawPolyStar;b._updateInstructions=function(){this._instructions=
this._oldInstructions.slice();this._instructions.push(a.beginCmd);this._fillInstructions&&this._instructions.push.apply(this._instructions,this._fillInstructions);this._strokeInstructions&&(this._instructions.push.apply(this._instructions,this._strokeInstructions),this._strokeStyleInstructions&&this._instructions.push.apply(this._instructions,this._strokeStyleInstructions));this._instructions.push.apply(this._instructions,this._activeInstructions);this._fillInstructions&&this._instructions.push(a.fillCmd);
this._strokeInstructions&&this._instructions.push(a.strokeCmd)};b._newPath=function(){this._dirty&&this._updateInstructions();this._oldInstructions=this._instructions;this._activeInstructions=[];this._active=this._dirty=false};b._setProp=function(b,a){this[b]=a};k.Graphics=a})(window);(function(k){var c=function(){this.initialize()},a=c.prototype;c.suppressCrossDomainErrors=false;c._hitTestCanvas=document.createElement("canvas");c._hitTestCanvas.width=c._hitTestCanvas.height=1;c._hitTestContext=c._hitTestCanvas.getContext("2d");a.alpha=1;a.cacheCanvas=null;a.id=-1;a.mouseEnabled=true;a.name=null;a.parent=null;a.regX=0;a.regY=0;a.rotation=0;a.scaleX=1;a.scaleY=1;a.skewX=0;a.skewY=0;a.shadow=null;a.visible=true;a.x=0;a.y=0;a.compositeOperation=null;a.snapToPixel=false;a.onPress=
null;a.onClick=null;a.onDoubleClick=null;a.onMouseOver=null;a.onMouseOut=null;a.tick=null;a.filters=null;a.cacheID=0;a._cacheOffsetX=0;a._cacheOffsetY=0;a._cacheDataURLID=0;a._cacheDataURL=null;a._matrix=null;a.initialize=function(){this.id=UID.get();this._matrix=new Matrix2D};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0};a.draw=function(b,a){if(a||!this.cacheCanvas)return false;b.drawImage(this.cacheCanvas,this._cacheOffsetX,this._cacheOffsetY);return true};
a.cache=function(b,a,c,e){if(this.cacheCanvas==null)this.cacheCanvas=document.createElement("canvas");var d=this.cacheCanvas.getContext("2d");this.cacheCanvas.width=c;this.cacheCanvas.height=e;d.clearRect(0,0,c+1,e+1);d.setTransform(1,0,0,1,-b,-a);this.draw(d,true,this._matrix.reinitialize(1,0,0,1,-b,-a));this._cacheOffsetX=b;this._cacheOffsetY=a;this._applyFilters();this.cacheID++};a.updateCache=function(b){if(this.cacheCanvas==null)throw"cache() must be called before updateCache()";var a=this.cacheCanvas.getContext("2d");
a.setTransform(1,0,0,1,-this._cacheOffsetX,-this._cacheOffsetY);b?a.globalCompositeOperation=b:a.clearRect(0,0,this.cacheCanvas.width+1,this.cacheCanvas.height+1);this.draw(a,true);if(b)a.globalCompositeOperation="source-over";this._applyFilters();this.cacheID++};a.uncache=function(){this._cacheDataURL=this.cacheCanvas=null;this._cacheOffsetX=this._cacheOffsetY=0};a.getCacheDataURL=function(){if(!this.cacheCanvas)return null;if(this.cacheID!=this._cacheDataURLID)this._cacheDataURL=this.cacheCanvas.toDataURL();
return this._cacheDataURL};a.getStage=function(){for(var b=this;b.parent;)b=b.parent;return b instanceof Stage?b:null};a.localToGlobal=function(b,a){var c=this.getConcatenatedMatrix(this._matrix);if(c==null)return null;c.append(1,0,0,1,b,a);return new Point(c.tx,c.ty)};a.globalToLocal=function(b,a){var c=this.getConcatenatedMatrix(this._matrix);if(c==null)return null;c.invert();c.append(1,0,0,1,b,a);return new Point(c.tx,c.ty)};a.localToLocal=function(b,a,c){b=this.localToGlobal(b,a);return c.globalToLocal(b.x,
b.y)};a.setTransform=function(b,a,c,e,d,g,h,j,i){this.x=b||0;this.y=a||0;this.scaleX=c==null?1:c;this.scaleY=e==null?1:e;this.rotation=d||0;this.skewX=g||0;this.skewY=h||0;this.regX=j||0;this.regY=i||0};a.getConcatenatedMatrix=function(b){b?b.identity():b=new Matrix2D;for(var a=this;a!=null;)b.prependTransform(a.x,a.y,a.scaleX,a.scaleY,a.rotation,a.skewX,a.skewY,a.regX,a.regY),b.prependProperties(a.alpha,a.shadow,a.compositeOperation),a=a.parent;return b};a.hitTest=function(b,a){var f=c._hitTestContext,
e=c._hitTestCanvas;f.setTransform(1,0,0,1,-b,-a);this.draw(f);f=this._testHit(f);e.width=0;e.width=1;return f};a.clone=function(){var b=new c;this.cloneProps(b);return b};a.toString=function(){return"[DisplayObject (name="+this.name+")]"};a.cloneProps=function(b){b.alpha=this.alpha;b.name=this.name;b.regX=this.regX;b.regY=this.regY;b.rotation=this.rotation;b.scaleX=this.scaleX;b.scaleY=this.scaleY;b.shadow=this.shadow;b.skewX=this.skewX;b.skewY=this.skewY;b.visible=this.visible;b.x=this.x;b.y=this.y;
b.mouseEnabled=this.mouseEnabled;b.compositeOperation=this.compositeOperation;if(this.cacheCanvas)b.cacheCanvas=this.cacheCanvas.cloneNode(true),b.cacheCanvas.getContext("2d").putImageData(this.cacheCanvas.getContext("2d").getImageData(0,0,this.cacheCanvas.width,this.cacheCanvas.height),0,0)};a.applyShadow=function(b,a){a=a||Shadow.identity;b.shadowColor=a.color;b.shadowOffsetX=a.offsetX;b.shadowOffsetY=a.offsetY;b.shadowBlur=a.blur};a._testHit=function(b){try{var a=b.getImageData(0,0,1,1).data[3]>
1}catch(f){if(!c.suppressCrossDomainErrors)throw"An error has occured. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images.";}return a};a._applyFilters=function(){if(this.filters&&this.filters.length!=0&&this.cacheCanvas)for(var b=this.filters.length,a=this.cacheCanvas.getContext("2d"),c=this.cacheCanvas.width,e=this.cacheCanvas.height,d=0;d<b;d++)this.filters[d].applyFilter(a,0,0,c,e)};k.DisplayObject=c})(window);(function(k){var c=function(){this.initialize()},a=c.prototype=new DisplayObject;a.children=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(){this.DisplayObject_initialize();this.children=[]};a.isVisible=function(){return this.visible&&this.alpha>0&&this.children.length&&this.scaleX!=0&&this.scaleY!=0};a.DisplayObject_draw=a.draw;a.draw=function(b,a,f){var e=Stage._snapToPixelEnabled;if(this.DisplayObject_draw(b,a))return true;for(var f=f||this._matrix.reinitialize(1,0,0,1,0,0,
this.alpha,this.shadow,this.compositeOperation),a=this.children.length,d=this.children.slice(0),g=0;g<a;g++){var h=d[g];if(h.isVisible()){var j=false,i=h._matrix.reinitialize(f.a,f.b,f.c,f.d,f.tx,f.ty,f.alpha,f.shadow,f.compositeOperation);i.appendTransform(h.x,h.y,h.scaleX,h.scaleY,h.rotation,h.skewX,h.skewY,h.regX,h.regY);i.appendProperties(h.alpha,h.shadow,h.compositeOperation);if(!(h instanceof c&&h.cacheCanvas==null))e&&h.snapToPixel&&i.a==1&&i.b==0&&i.c==0&&i.d==1?b.setTransform(i.a,i.b,i.c,
i.d,i.tx+0.5|0,i.ty+0.5|0):b.setTransform(i.a,i.b,i.c,i.d,i.tx,i.ty),b.globalAlpha=i.alpha,b.globalCompositeOperation=i.compositeOperation||"source-over",(j=i.shadow)&&this.applyShadow(b,j);h.draw(b,false,i);j&&this.applyShadow(b)}}return true};a.addChild=function(b){var a=arguments.length;if(a>1){for(var c=0;c<a;c++)this.addChild(arguments[c]);return arguments[a-1]}b.parent&&b.parent.removeChild(b);b.parent=this;this.children.push(b);return b};a.addChildAt=function(b,a){var c=arguments.length;if(c>
2){for(var a=arguments[e-1],e=0;e<c-1;e++)this.addChildAt(arguments[e],a+e);return arguments[c-2]}b.parent&&b.parent.removeChild(b);b.parent=this;this.children.splice(a,0,b);return b};a.removeChild=function(b){var a=arguments.length;if(a>1){for(var c=true,e=0;e<a;e++)c=c&&this.removeChild(arguments[e]);return c}return this.removeChildAt(this.children.indexOf(b))};a.removeChildAt=function(b){var a=arguments.length;if(a>1){for(var c=[],e=0;e<a;e++)c[e]=arguments[e];c.sort(function(b,a){return a-b});
for(var d=true,e=0;e<a;e++)d=d&&this.removeChildAt(c[e]);return d}if(b<0||b>this.children.length-1)return false;a=this.children[b];if(a!=null)a.parent=null;this.children.splice(b,1);return true};a.removeAllChildren=function(){for(;this.children.length;)this.removeChildAt(0)};a.getChildAt=function(b){return this.children[b]};a.sortChildren=function(b){this.children.sort(b)};a.getChildIndex=function(b){return this.children.indexOf(b)};a.getNumChildren=function(){return this.children.length};a.contains=
function(b){for(;b;){if(b==this)return true;b=b.parent}return false};a.hitTest=function(b,a){return this.getObjectUnderPoint(b,a)!=null};a.getObjectsUnderPoint=function(b,a){var c=[],e=this.localToGlobal(b,a);this._getObjectsUnderPoint(e.x,e.y,c);return c};a.getObjectUnderPoint=function(b,a){var c=this.localToGlobal(b,a);return this._getObjectsUnderPoint(c.x,c.y)};a.clone=function(b){var a=new c;this.cloneProps(a);if(b)for(var f=a.children=[],e=0,d=this.children.length;e<d;e++){var g=this.children[e].clone(b);
g.parent=a;f.push(g)}return a};a.toString=function(){return"[Container (name="+this.name+")]"};a._tick=function(){for(var b=this.children.length-1;b>=0;b--){var a=this.children[b];a._tick&&a._tick();a.tick&&a.tick()}};a._getObjectsUnderPoint=function(b,a,f,e){var d=DisplayObject._hitTestContext,g=DisplayObject._hitTestCanvas,h=this._matrix,j=e&1&&(this.onPress||this.onClick||this.onDoubleClick)||e&2&&(this.onMouseOver||this.onMouseOut);if(this.cacheCanvas)if(this.getConcatenatedMatrix(h),d.setTransform(h.a,
h.b,h.c,h.d,h.tx-b,h.ty-a),d.globalAlpha=h.alpha,this.draw(d),this._testHit(d)){if(g.width=0,g.width=1,j)return this}else return null;for(var i=this.children.length-1;i>=0;i--){var l=this.children[i];if(l.isVisible()&&l.mouseEnabled)if(l instanceof c)if(j){if(l=l._getObjectsUnderPoint(b,a))return this}else{if(l=l._getObjectsUnderPoint(b,a,f,e),!f&&l)return l}else if(!e||j||e&1&&(l.onPress||l.onClick||l.onDoubleClick)||e&2&&(l.onMouseOver||l.onMouseOut))if(l.getConcatenatedMatrix(h),d.setTransform(h.a,
h.b,h.c,h.d,h.tx-b,h.ty-a),d.globalAlpha=h.alpha,l.draw(d),this._testHit(d))if(g.width=0,g.width=1,j)return this;else if(f)f.push(l);else return l}return null};k.Container=c})(window);(function(k){var c=function(b){this.initialize(b)},a=c.prototype=new Container;c._snapToPixelEnabled=false;a.autoClear=true;a.canvas=null;a.mouseX=null;a.mouseY=null;a.onMouseMove=null;a.onMouseUp=null;a.onMouseDown=null;a.snapToPixelEnabled=false;a.mouseInBounds=false;a.tickOnUpdate=true;a._activeMouseEvent=null;a._activeMouseTarget=null;a._mouseOverIntervalID=null;a._mouseOverX=0;a._mouseOverY=0;a._mouseOverTarget=null;a.Container_initialize=a.initialize;a.initialize=function(b){this.Container_initialize();
this.canvas=b;this._enableMouseEvents(true)};a.update=function(){if(this.canvas)this.autoClear&&this.clear(),c._snapToPixelEnabled=this.snapToPixelEnabled,this.tickOnUpdate&&this._tick(),this.draw(this.canvas.getContext("2d"),false,this.getConcatenatedMatrix(this._matrix))};a.tick=a.update;a.clear=function(){if(this.canvas){var b=this.canvas.getContext("2d");b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,this.canvas.width,this.canvas.height)}};a.toDataURL=function(b,a){a||(a="image/png");var c=this.canvas.getContext("2d"),
e=this.canvas.width,d=this.canvas.height,g;if(b){g=c.getImageData(0,0,e,d);var h=c.globalCompositeOperation;c.globalCompositeOperation="destination-over";c.fillStyle=b;c.fillRect(0,0,e,d)}var j=this.canvas.toDataURL(a);if(b)c.clearRect(0,0,e,d),c.putImageData(g,0,0),c.globalCompositeOperation=h;return j};a.enableMouseOver=function(b){if(this._mouseOverIntervalID)clearInterval(this._mouseOverIntervalID),this._mouseOverIntervalID=null;if(!(b<=0)){var a=this;this._mouseOverIntervalID=setInterval(function(){a._testMouseOver()},
1E3/Math.min(50,b));this._mouseOverX=NaN;this._mouseOverTarget=null}};a.clone=function(){var b=new c(null);this.cloneProps(b);return b};a.toString=function(){return"[Stage (name="+this.name+")]"};a._enableMouseEvents=function(){var b=this,a=k.addEventListener?k:document;a.addEventListener("mouseup",function(a){b._handleMouseUp(a)},false);a.addEventListener("mousemove",function(a){b._handleMouseMove(a)},false);a.addEventListener("dblclick",function(a){b._handleDoubleClick(a)},false);this.canvas&&this.canvas.addEventListener("mousedown",
function(a){b._handleMouseDown(a)},false)};a._handleMouseMove=function(b){if(this.canvas){if(!b)b=k.event;var a=this.mouseInBounds;this._updateMousePosition(b.pageX,b.pageY);if(a||this.mouseInBounds){b=new MouseEvent("onMouseMove",this.mouseX,this.mouseY,this,b);if(this.onMouseMove)this.onMouseMove(b);if(this._activeMouseEvent&&this._activeMouseEvent.onMouseMove)this._activeMouseEvent.onMouseMove(b)}}else this.mouseX=this.mouseY=null};a._updateMousePosition=function(b,a){var c=this.canvas;do b-=c.offsetLeft,
a-=c.offsetTop;while(c=c.offsetParent);if(this.mouseInBounds=b>=0&&a>=0&&b<this.canvas.width&&a<this.canvas.height)this.mouseX=b,this.mouseY=a};a._handleMouseUp=function(b){var a=new MouseEvent("onMouseUp",this.mouseX,this.mouseY,this,b);if(this.onMouseUp)this.onMouseUp(a);if(this._activeMouseEvent&&this._activeMouseEvent.onMouseUp)this._activeMouseEvent.onMouseUp(a);if(this._activeMouseTarget&&this._activeMouseTarget.onClick&&this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,true,this._mouseOverIntervalID?
3:1)==this._activeMouseTarget)this._activeMouseTarget.onClick(new MouseEvent("onClick",this.mouseX,this.mouseY,this._activeMouseTarget,b));this._activeMouseEvent=this._activeMouseTarget=null};a._handleMouseDown=function(b){if(this.onMouseDown)this.onMouseDown(new MouseEvent("onMouseDown",this.mouseX,this.mouseY,this,b));var a=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,this._mouseOverIntervalID?3:1);if(a){if(a.onPress instanceof Function&&(b=new MouseEvent("onPress",this.mouseX,this.mouseY,
a,b),a.onPress(b),b.onMouseMove||b.onMouseUp))this._activeMouseEvent=b;this._activeMouseTarget=a}};a._testMouseOver=function(){if(!(this.mouseX==this._mouseOverX&&this.mouseY==this._mouseOverY&&this.mouseInBounds)){var b=null;if(this.mouseInBounds)b=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,3),this._mouseOverX=this.mouseX,this._mouseOverY=this.mouseY;if(this._mouseOverTarget!=b){if(this._mouseOverTarget&&this._mouseOverTarget.onMouseOut)this._mouseOverTarget.onMouseOut(new MouseEvent("onMouseOut",
this.mouseX,this.mouseY,this._mouseOverTarget));if(b&&b.onMouseOver)b.onMouseOver(new MouseEvent("onMouseOver",this.mouseX,this.mouseY,b));this._mouseOverTarget=b}}};a._handleDoubleClick=function(b){if(this.onDoubleClick)this.onDoubleClick(new MouseEvent("onDoubleClick",this.mouseX,this.mouseY,this,b));var a=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,this._mouseOverIntervalID?3:1);if(a&&a.onDoubleClick instanceof Function)a.onDoubleClick(new MouseEvent("onPress",this.mouseX,this.mouseY,
a,b))};k.Stage=c})(window);(function(k){var c=function(b){this.initialize(b)},a=c.prototype=new DisplayObject;a.image=null;a.snapToPixel=true;a.DisplayObject_initialize=a.initialize;a.initialize=function(b){this.DisplayObject_initialize();typeof b=="string"?(this.image=new Image,this.image.src=b):this.image=b};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0&&this.image&&(this.image.complete||this.image.getContext||this.image.readyState==2)};a.DisplayObject_draw=a.draw;a.draw=function(b,
a){if(this.DisplayObject_draw(b,a))return true;b.drawImage(this.image,0,0);return true};a.clone=function(){var b=new c(this.image);this.cloneProps(b);return b};a.toString=function(){return"[Bitmap (name="+this.name+")]"};k.Bitmap=c})(window);(function(k){var c=function(b){this.initialize(b)},a=c.prototype=new DisplayObject;a.onAnimationEnd=null;a.currentFrame=-1;a.currentAnimation=null;a.paused=true;a.spriteSheet=null;a.snapToPixel=true;a.offset=0;a.currentAnimationFrame=0;a._advanceCount=0;a._animation=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(b){this.DisplayObject_initialize();this.spriteSheet=b};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0&&this.spriteSheet.complete&&
this.currentFrame>=0};a.DisplayObject_draw=a.draw;a.draw=function(b,a){if(this.DisplayObject_draw(b,a))return true;this._normalizeFrame();var c=this.spriteSheet.getFrame(this.currentFrame);if(c!=null){var e=c.rect;b.drawImage(c.image,e.x,e.y,e.width,e.height,-c.regX,-c.regY,e.width,e.height);return true}};a.gotoAndPlay=function(b){this.paused=false;this._goto(b)};a.gotoAndStop=function(b){this.paused=true;this._goto(b)};a.advance=function(){this._animation?this.currentAnimationFrame++:this.currentFrame++;
this._normalizeFrame()};a.clone=function(){var b=new c(this.spriteSheet);this.cloneProps(b);return b};a.toString=function(){return"[BitmapAnimation (name="+this.name+")]"};a._tick=function(){var b=this._animation?this._animation.frequency:1;!this.paused&&(++this._advanceCount+this.offset)%b==0&&this.advance()};a._normalizeFrame=function(){var b=this._animation;if(b)if(this.currentAnimationFrame>=b.frames.length){if(b.next?this._goto(b.next):(this.paused=true,this.currentAnimationFrame=b.frames.length-
1,this.currentFrame=b.frames[this.currentAnimationFrame]),this.onAnimationEnd)this.onAnimationEnd(this,b.name)}else this.currentFrame=b.frames[this.currentAnimationFrame];else if(this.currentFrame>=this.spriteSheet.getNumFrames()&&(this.currentFrame=0,this.onAnimationEnd))this.onAnimationEnd(this,null)};a.DisplayObject_cloneProps=a.cloneProps;a.cloneProps=function(b){this.DisplayObject_cloneProps(b);b.onAnimationEnd=this.onAnimationEnd;b.currentFrame=this.currentFrame;b.currentAnimation=this.currentAnimation;
b.paused=this.paused;b.offset=this.offset;b._animation=this._animation;b.currentAnimationFrame=this.currentAnimationFrame};a._goto=function(b){if(isNaN(b)){var a=this.spriteSheet.getAnimation(b);if(a)this.currentAnimationFrame=0,this._animation=a,this.currentAnimation=b,this._normalizeFrame()}else this.currentAnimation=this._animation=null,this.currentFrame=b};k.BitmapAnimation=c})(window);(function(k){var c=function(b){this.initialize(b)},a=c.prototype=new DisplayObject;a.graphics=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(b){this.DisplayObject_initialize();this.graphics=b?b:new Graphics};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0&&this.graphics};a.DisplayObject_draw=a.draw;a.draw=function(b,a){if(this.DisplayObject_draw(b,a))return true;this.graphics.draw(b);return true};a.clone=function(b){b=new c(b&&this.graphics?
this.graphics.clone():this.graphics);this.cloneProps(b);return b};a.toString=function(){return"[Shape (name="+this.name+")]"};k.Shape=c})(window);(function(k){var c=function(b,a,c){this.initialize(b,a,c)},a=c.prototype=new DisplayObject;c._workingContext=document.createElement("canvas").getContext("2d");a.text="";a.font=null;a.color=null;a.textAlign=null;a.textBaseline=null;a.maxWidth=null;a.outline=false;a.lineHeight=null;a.lineWidth=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(b,a,c){this.DisplayObject_initialize();this.text=b;this.font=a;this.color=c?c:"#000"};a.isVisible=function(){return Boolean(this.visible&&this.alpha>
0&&this.scaleX!=0&&this.scaleY!=0&&this.text!=null&&this.text!="")};a.DisplayObject_draw=a.draw;a.draw=function(b,a){if(this.DisplayObject_draw(b,a))return true;this.outline?b.strokeStyle=this.color:b.fillStyle=this.color;b.font=this.font;b.textAlign=this.textAlign?this.textAlign:"start";b.textBaseline=this.textBaseline?this.textBaseline:"alphabetic";for(var c=String(this.text).split(/(?:\r\n|\r|\n)/),e=this.lineHeight==null?this.getMeasuredLineHeight():this.lineHeight,d=0,g=0,h=c.length;g<h;g++){var j=
b.measureText(c[g]).width;if(this.lineWidth==null||j<this.lineWidth)this._drawTextLine(b,c[g],d);else{for(var j=c[g].split(/(\s)/),i=j[0],l=1,k=j.length;l<k;l+=2)b.measureText(i+j[l]+j[l+1]).width>this.lineWidth?(this._drawTextLine(b,i,d),d+=e,i=j[l+1]):i+=j[l]+j[l+1];this._drawTextLine(b,i,d)}d+=e}return true};a.getMeasuredWidth=function(){return this._getWorkingContext().measureText(this.text).width};a.getMeasuredLineHeight=function(){return this._getWorkingContext().measureText("M").width*1.2};
a.clone=function(){var b=new c(this.text,this.font,this.color);this.cloneProps(b);return b};a.toString=function(){return"[Text (text="+(this.text.length>20?this.text.substr(0,17)+"...":this.text)+")]"};a.DisplayObject_cloneProps=a.cloneProps;a.cloneProps=function(b){this.DisplayObject_cloneProps(b);b.textAlign=this.textAlign;b.textBaseline=this.textBaseline;b.maxWidth=this.maxWidth;b.outline=this.outline;b.lineHeight=this.lineHeight;b.lineWidth=this.lineWidth};a._getWorkingContext=function(){var b=
c._workingContext;b.font=this.font;b.textAlign=this.textAlign?this.textAlign:"start";b.textBaseline=this.textBaseline?this.textBaseline:"alphabetic";return b};a._drawTextLine=function(b,a,c){this.outline?b.strokeText(a,0,c,this.maxWidth):b.fillText(a,0,c,this.maxWidth)};k.Text=c})(window);(function(k){var c=function(){throw"SpriteSheetUtils cannot be instantiated";};c._workingCanvas=document.createElement("canvas");c._workingContext=c._workingCanvas.getContext("2d");c.addFlippedFrames=function(a,b,o,f){if(b||o||f){var e=0;b&&c._flip(a,++e,true,false);o&&c._flip(a,++e,false,true);f&&c._flip(a,++e,true,true)}};c.extractFrame=function(a,b){isNaN(b)&&(b=a.getAnimation(b).frames[0]);var o=a.getFrame(b);if(!o)return null;var f=o.rect,e=c._workingCanvas;e.width=f.width;e.height=f.height;
c._workingContext.drawImage(o.image,f.x,f.y,f.width,f.height,0,0,f.width,f.height);o=new Image;o.src=e.toDataURL("image/png");return o};c._flip=function(a,b,o,f){for(var e=a._images,d=c._workingCanvas,g=c._workingContext,h=e.length/b,j=0;j<h;j++){var i=e[j];i.__tmp=j;d.width=i.width;d.height=i.height;g.setTransform(o?-1:1,0,0,f?-1:1,o?i.width:0,f?i.height:0);g.drawImage(i,0,0);var k=new Image;k.src=d.toDataURL("image/png");e.push(k)}g=a._frames;d=g.length/b;for(j=0;j<d;j++){var i=g[j],m=i.rect.clone(),
k=e[i.image.__tmp+h*b],q={image:k,rect:m,regX:i.regX,regY:i.regY};if(o)m.x=k.width-m.x-m.width,q.regX=m.width-i.regX;if(f)m.y=k.height-m.y-m.height,q.regY=m.height-i.regY;g.push(q)}o="_"+(o?"h":"")+(f?"v":"");f=a._animations;a=a._data;e=f.length/b;for(j=0;j<e;j++){g=f[j];i=a[g];h={name:g+o,frequency:i.frequency,next:i.next,frames:[]};i.next&&(h.next+=o);g=i.frames;i=0;for(k=g.length;i<k;i++)h.frames.push(g[i]+d*b);a[h.name]=h;f.push(h.name)}};k.SpriteSheetUtils=c})(window);(function(k){var c=function(b){this.initialize(b)},a=c.prototype=new DisplayObject;a.htmlElement=null;a._style=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(b){typeof b=="string"&&(b=document.getElementById(b));this.DisplayObject_initialize();this.mouseEnabled=false;if(this.htmlElement=b)this._style=b.style,this._style.position="absolute",this._style.transformOrigin=this._style.webkitTransformOrigin=this._style.MozTransformOrigin="0% 0%"};a.isVisible=function(){return this.htmlElement!=
null};a.draw=function(){if(this.htmlElement!=null){var b=this._matrix,a=this.htmlElement;a.style.opacity=""+b.alpha;a.style.visibility=this.visible?"visible":"hidden";a.style.transform=a.style.webkitTransform=a.style.oTransform=["matrix("+b.a,b.b,b.c,b.d,b.tx,b.ty+")"].join(",");a.style.MozTransform=["matrix("+b.a,b.b,b.c,b.d,b.tx+"px",b.ty+"px)"].join(",");return true}};a.cache=function(){};a.uncache=function(){};a.updateCache=function(){};a.hitTest=function(){};a.localToGlobal=function(){};a.globalToLocal=
function(){};a.localToLocal=function(){};a.clone=function(){var b=new c;this.cloneProps(b);return b};a.toString=function(){return"[DOMElement (name="+this.name+")]"};a._tick=function(){if(this.htmlElement!=null)this.htmlElement.style.visibility="hidden"};k.DOMElement=c})(window);(function(k){var c=function(){this.initialize()},a=c.prototype;a.initialize=function(){};a.getBounds=function(){return new Rectangle(0,0,0,0)};a.applyFilter=function(){};a.toString=function(){return"[Filter]"};a.clone=function(){return new c};k.Filter=c})(window);(function(k){var c=function(b,a,c){this.initialize(b,a,c)},a=c.prototype=new Filter;a.initialize=function(b,a,c){if(isNaN(b)||b<0)b=0;this.blurX=b|0;if(isNaN(a)||a<0)a=0;this.blurY=a|0;if(isNaN(c)||c<1)c=1;this.quality=c|0};a.blurX=0;a.blurY=0;a.quality=1;a.getBounds=function(){return new Rectangle(-this.blurX,-this.blurY,2*this.blurX,2*this.blurY)};a.applyFilter=function(b,a,c,e,d,g,h,j){g=g||b;h==null&&(h=a);j==null&&(j=c);try{var i=b.getImageData(a,c,e,d)}catch(k){return false}b=this.blurX;if(isNaN(b)||
b<0)return false;b|=0;var m=this.blurY;if(isNaN(m)||m<0)return false;m|=0;if(b==0&&m==0)return false;var q=this.quality;if(isNaN(q)||q<1)q=1;q|=0;q>3&&(q=3);q<1&&(q=1);for(var n=i.data,s,w,x,y,p,u,t,v,H=e-1,I=d-1,z=b+1,A=m+1,F=1/((b+z)*(m+A)),B=[],C=[],D=[],E=[],G=[],r=[];q-- >0;){for(c=v=t=0;c<d;c++){s=n[v]*z;w=n[v+1]*z;x=n[v+2]*z;y=n[v+3]*z;for(p=1;p<=b;p++)a=v+((p>H?H:p)<<2),s+=n[a++],w+=n[a++],x+=n[a++],y+=n[a];for(a=0;a<e;a++)B[t]=s,C[t]=w,D[t]=x,E[t]=y,c==0&&(G[a]=Math.min(a+z,H)<<2,r[a]=Math.max(a-
b,0)<<2),p=v+G[a],u=v+r[a],s+=n[p++]-n[u++],w+=n[p++]-n[u++],x+=n[p++]-n[u++],y+=n[p]-n[u],t++;v+=e<<2}for(a=0;a<e;a++){c=a;s=B[c]*A;w=C[c]*A;x=D[c]*A;y=E[c]*A;for(p=1;p<=m;p++)c+=p>I?0:e,s+=B[c],w+=C[c],x+=D[c],y+=E[c];t=a<<2;for(c=0;c<d;c++)n[t]=s*F+0.5|0,n[t+1]=w*F+0.5|0,n[t+2]=x*F+0.5|0,n[t+3]=y*F+0.5|0,a==0&&(G[c]=Math.min(c+A,I)*e,r[c]=Math.max(c-m,0)*e),p=a+G[c],u=a+r[c],s+=B[p]-B[u],w+=C[p]-C[u],x+=D[p]-D[u],y+=E[p]-E[u],t+=e<<2}}g.putImageData(i,h,j);return true};a.clone=function(){return new c(this.blurX,
this.blurY,this.quality)};a.toString=function(){return"[BoxBlurFilter (name="+this.name+")]"};k.BoxBlurFilter=c})(window);(function(k){var c=function(a,c,f,e,d,g,h,j){this.initialize(a,c,f,e,d,g,h,j)},a=c.prototype=new Filter;a.redMultiplier=1;a.greenMultiplier=1;a.blueMultiplier=1;a.alphaMultiplier=1;a.redOffset=0;a.greenOffset=0;a.blueOffset=0;a.alphaOffset=0;a.initialize=function(a,c,f,e,d,g,h,j){this.redMultiplier=a!=null?a:1;this.greenMultiplier=c!=null?c:1;this.blueMultiplier=f!=null?f:1;this.alphaMultiplier=e!=null?e:1;this.redOffset=d||0;this.greenOffset=g||0;this.blueOffset=h||0;this.alphaOffset=j||0};a.applyFilter=
function(a,c,f,e,d,g,h,j){g=g||a;h==null&&(h=c);j==null&&(j=f);try{var i=a.getImageData(c,f,e,d)}catch(k){return false}a=i.data;c=a.length;for(f=0;f<c;f+=4)a[f]=a[f]*this.redMultiplier+this.redOffset,a[f+1]=a[f+1]*this.greenMultiplier+this.greenOffset,a[f+2]=a[f+2]*this.blueMultiplier+this.blueOffset,a[f+3]=a[f+3]*this.alphaMultiplier+this.alphaOffset;i.data=a;g.putImageData(i,h,j);return true};a.toString=function(){return"[ColorFilter]"};a.clone=function(){return new c(this.redMultiplier,this.greenMultiplier,
this.blueMultiplier,this.alphaMultiplier,this.redOffset,this.greenOffset,this.blueOffset,this.alphaOffset)};k.ColorFilter=c})(window);(function(k){var c=function(a){this.initialize(a)},a=c.prototype=new Filter;a.matrix=null;a.initialize=function(a){this.matrix=a};a.applyFilter=function(a,c,f,e,d,g,h,j){g=g||a;h==null&&(h=c);j==null&&(j=f);try{var i=a.getImageData(c,f,e,d)}catch(k){return false}var a=i.data,c=a.length,m,q,n,s;m=this.matrix;for(var f=m[0],e=m[1],d=m[2],w=m[3],x=m[4],y=m[5],p=m[6],u=m[7],t=m[8],v=m[9],H=m[10],I=m[11],z=m[12],A=m[13],F=m[14],B=m[15],C=m[16],D=m[17],E=m[18],G=m[19],r=0;r<c;r+=4)m=a[r],q=a[r+1],n=a[r+
2],s=a[r+3],a[r]=m*f+q*e+n*d+s*w+x,a[r+1]=m*y+q*p+n*u+s*t+v,a[r+2]=m*H+q*I+n*z+s*A+F,a[r+3]=m*B+q*C+n*D+s*E+G;i.data=a;g.putImageData(i,h,j);return true};a.toString=function(){return"[ColorMatrixFilter]"};a.clone=function(){return new c(this.matrix)};k.ColorMatrixFilter=c})(window);(function(k){var c=function(){throw"Touch cannot be instantiated";};c.isSupported=function(){return"ontouchstart"in k};c.enable=function(a){if(a!=null&&c.isSupported())a._primaryTouchId=-1,a._handleTouchMoveListener=null,a.canvas.addEventListener("touchstart",function(b){c._handleTouchStart(a,b)},false),document.addEventListener("touchend",function(b){c._handleTouchEnd(a,b)},false)};c._handleTouchStart=function(a,b){b.preventDefault();if(a._primaryTouchId==-1){a._handleTouchMoveListener=a._handleTouchMoveListener||
function(b){c._handleTouchMove(a,b)};document.addEventListener("touchmove",a._handleTouchMoveListener,false);var k=b.changedTouches[0];a._primaryTouchId=k.identifier;a._updateMousePosition(k.pageX,k.pageY);a._handleMouseDown(k)}};c._handleTouchMove=function(a,b){var k=c._findPrimaryTouch(a,b.changedTouches);k&&a._handleMouseMove(k)};c._handleTouchEnd=function(a,b){var k=c._findPrimaryTouch(a,b.changedTouches);if(k)a._primaryTouchId=-1,a._handleMouseUp(k),document.removeEventListener("touchmove",a._handleTouchMoveListener),
a._handleTouchMoveListener=null};c._findPrimaryTouch=function(a,b){for(var c=b.length,f=0;f<c;f++){var e=b[f];if(e.identifier==a._primaryTouchId)return e}return null};k.Touch=c})(window);
